<template>
  <div class="ma-content-block lg:flex justify-between p-4">
    <!-- CRUD 组件 -->
    <ma-crud :options="options" :columns="columns" ref="crudRef">
    </ma-crud>
  </div>
</template>
<script setup>
import {ref, reactive} from 'vue'
import backendCorpPluginHidden from '@/api/backend/backendCorpPluginHidden'
import {Message} from '@arco-design/web-vue'
import tool from '@/utils/tool'
import * as common from '@/utils/common'

const crudRef = ref()


const options = reactive({
  id: 'backend_corp_plugin_hidden',
  rowSelection: {
    showCheckedAll: true
  },
  pk: 'id',
  operationColumn: true,
  operationColumnWidth: 160,
  formOption: {
    viewType: 'drawer',
    width: 600
  },
  api: backendCorpPluginHidden.getList,
  add: {
    show: true,
    api: backendCorpPluginHidden.save,
    auth: ['backend:corpPluginHidden:save']
  },
  edit: {
    show: true,
    api: backendCorpPluginHidden.update,
    auth: ['backend:corpPluginHidden:update']
  },
  delete: {
    show: true,
    api: backendCorpPluginHidden.deletes,
    auth: ['backend:corpPluginHidden:delete']
  }
})

const columns = reactive([
  {
    title: "主键",
    dataIndex: "id",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true
  },
  {
    title: "公司",
    dataIndex: "corp_id",
    formType: "select",
    multiple: false,
    dict: {
      remote: 'corp/remote',
      method: 'post',
      props: {label: 'name', value: 'id'},
      remoteOption: {
        select: ['id', 'name']
      },
      translation: true
    },
  },
  {
    title: "隐藏插件",
    dataIndex: "plugin_id",
    formType: "select",
    multiple: true,
    dict: {
      remote: 'backend/plugin/remote',
      method: 'post',
      props: {label: 'name', value: 'id'},
      remoteOption: {
        select: ['id', 'name']
      },
      translation: true
    },
  }
])
</script>
<script> export default {name: 'backend:corpPluginHidden'} </script>